package lambda;

public class AddableDemo {
    public static void main(String[] args) {
        useAdd((int a , int b) -> {
            return a+b;
        });

        // 得到总和
        useAdd(Math::addExact);

    }

    private static void useAdd(Addable ad) {
        int add = ad.add(10, 20);
        System.out.println(add);
    }
}
